package com.zdsoft.crm.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import com.zdsoft.crm.entity.Clue;
public interface IClueMapper {

	@Select("SELECT * FROM("
			+ "SELECT A.*,ROWNUM RN "
			+ "FROM "
			+ " (SELECT * FROM CLUE ) A"
			+ " WHERE ROWNUM<=#{endIndex})  TL "
			+ " WHERE RN > #{startIndex}"
			+ " and CHARGE_USER_ID is not null")
	List<Clue> pageList(@Param("startIndex") Integer startIndex, @Param("endIndex") Integer endIndex);
	
	@Select("select count(id) from CLUE")
	Long totalCount();
	
	@Select("select * from CLUE where id = #{id}")
	Clue getClueInfo(String id);
	
	/**
	 * 删除
	 * @param id
	 * @return
	 */
	@Delete("delete from CLUE where id = #{id}")
	public int delete(String id);
}
